﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using System.Drawing;

namespace ImageEditor
{
    class MapKey : Panel
    {

        public MapKey()
        {
            InitializeMapKey();
        }

        private void InitializeMapKey()
        {
            Size size = new Size(40, 20);

            Panel none = new Panel();
            none.BackColor = Color.LightGray;
            none.Size = size;
            none.Location = new Point(10, 40);
            none.BorderStyle = BorderStyle.FixedSingle;

            Panel sporadic = new Panel();
            sporadic.BackColor = Color.LightBlue;
            sporadic.Size = size;
            sporadic.Location = new Point(10, 70);
            sporadic.BorderStyle = BorderStyle.FixedSingle;

            Panel local = new Panel();
            local.BackColor = Color.BlueViolet;
            local.Size = size;
            local.Location = new Point(10, 100);
            local.BorderStyle = BorderStyle.FixedSingle;

            Panel regional = new Panel();
            regional.BackColor = Color.DeepSkyBlue;
            regional.Size = size;
            regional.Location = new Point(10, 130);
            regional.BorderStyle = BorderStyle.FixedSingle;

            Panel widespread = new Panel();
            widespread.BackColor = Color.PaleVioletRed;
            widespread.Size = size;
            widespread.Location = new Point(10, 160);
            widespread.BorderStyle = BorderStyle.FixedSingle;

            this.Controls.Add(none);
            this.Controls.Add(sporadic);  
            this.Controls.Add(local);      
            this.Controls.Add(regional);   
            this.Controls.Add(widespread);
            this.Size = new Size(200, 200);
            this.BorderStyle = BorderStyle.FixedSingle;
            this.Location = new Point(950, 400);
        }

        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            e.Graphics.DrawString("Activity Levels", new Font(FontFamily.GenericSerif, 12.0F), new SolidBrush(Color.White), new PointF(50, 10));
            e.Graphics.DrawString("No Activity", new Font(FontFamily.GenericSerif, 12.0F), new SolidBrush(Color.White), new PointF(60, 40));
            e.Graphics.DrawString("Sporadic", new Font(FontFamily.GenericSerif, 12.0F), new SolidBrush(Color.White), new PointF(60, 70));
            e.Graphics.DrawString("Local Activity", new Font(FontFamily.GenericSerif, 12.0F), new SolidBrush(Color.White), new PointF(60, 100));
            e.Graphics.DrawString("Regional", new Font(FontFamily.GenericSerif, 12.0F), new SolidBrush(Color.White), new PointF(60, 130));
            e.Graphics.DrawString("Widespread", new Font(FontFamily.GenericSerif, 12.0F), new SolidBrush(Color.White), new PointF(60, 160));
        }
    }
}
